@extends('www/zc-admin/layout')
@section('content')

<div class="main-container">

    @include("/www/zc-admin/left-nav",['typeId'=>$typeId,'nav'=>'total'])



    <div class="main-content">

        <div class="content-anv">
            <span>首页</span>
            <span> ></span>
            <span>总凑总览</span>

            <ul>
                <li><span>众筹中：</span><span class="num">{{$total - $finish}}</span></li>
                <li><span>已完成：</span><span class="num">{{$finish}}</span></li>
                <li><span>总计：</span><span class="num">{{$total}}</span></li>
            </ul>
        </div>


        <form action="?typeId={{$typeId}}" class="seach-box" method="get">
            <input type="hidden" name="typeId" value="{{$typeId}}">
            <?php  $status = Request::input('status',-1);?>

            <select name="showchild">
                <option value="0">不显示子订单</option>
                <option value="1" @if(Request::input('showchild') == 1) selected @endif >显示子订单</option>
            </select>

            <select name="sort">
                @if(Request::input('sort') =='money')
                    <option value="time">订单最新排序</option>
                    <option value="money" selected>金额由高到低</option>
                @else
                    <option value="time" selected>订单最新排序</option>
                    <option value="money">金额由高到低</option>
                @endif
            </select>

            <select name="activityId">
                <option value="0">选择活动</option>
                @foreach($activitys as $act)
                    <option value="{{$act->activity_id}}" @if($act->activity_id == Request::input('activityId')) selected @endif >{{$act->title}}</option>
                @endforeach
            </select>
            <select name="handStatus">
                <?php $handStatus = Request::input('handStatus','-1') ?>
                    <option value="-1" @if($handStatus == "-1") selected @endif >处理状态</option>
                    <option value="1"  @if($handStatus == "1")  selected @endif >已处理</option>
                    <option value="0"  @if($handStatus == "0")  selected @endif >未处理</option>
            </select>

            <input type="text" name="title" placeholder="请输入标题" value="{{Request::input('title','')}}">
            <input type="text" name="wxname" placeholder="请输入微信名称" value="{{Request::input('wxname','')}}">
            <input type="text" name="mobile" placeholder="请输入手机号" value="{{Request::input('mobile','')}}">

            <p><img src="/www/zc666/images/admin/daochu.png"></p>
            <p><img src="/www/zc666/images/admin/seach.png" onclick="$('form').submit();"></p>
        </form>

        <style>
            .child-table{
                width:100%;
            }
            .child-table td,.child-table th{
                line-height:25px;
                padding:0;
            }
            .child-table th{
                border:none;
            }
            .child-table tr td{
                font-size:12px;
                width:50px;
                border-bottom:none;
            }

            table td.child{
                width:50px;
                padding:0 !important;
            }
        </style>
        <table class="table">
            <tr>
                <th>ID</th>
                <th>标题</th>
                <th>微信号</th>
                <th>姓名</th>
                <th>电话</th>
                <th>筹款金额</th>
                <th>已筹金额</th>
                <th>支持人数</th>
                <th colspan="4" style="padding:0;">
                    <table class="child-table">
                        <tr><th colspan="4" style="border-top:0;">子订单</th></tr>
                        <tr>
                            <td style="border-left:none;">总计</td>
                            <td>已完成</td>
                            <td>进行中</td>
                            <td>所有</td>
                        </tr>
                    </table>
                </th>
                {{--<th>进行中</th>--}}
                {{--<th>总计</th>--}}
                <th>开始时间</th>
                <th>结束时间</th>
                <th>操作</th>
            </tr>

            @foreach($orders as $order)
                <tr>
                    <td>{{$order->id}}</td>
                    <td>{{$order->title}}</td>
                    <td>{{$order->wx_name}}</td>
                    <td>{{$order->real_name}}</td>
                    <td>{{$order->mobile}}</td>
                    <td>{{$order->money}}</td>
                    <td>{{$order->raised_money}}</td>
                    <td>{{$order->supports_num}}</td>

                    <td class="child"><a href="/www/zhongchouAdmin/child_order?typeId={{$typeId}}&parentId={{$order->id}}&type=2">{{$order->child_num}}</a></td>
                    <td class="child"><a href="/www/zhongchouAdmin/child_order?typeId={{$typeId}}&parentId={{$order->id}}&type=1">{{$order->child_finished_num}}</a></td>
                    <td class="child"><a href="/www/zhongchouAdmin/child_order?typeId={{$typeId}}&parentId={{$order->id}}&type=0">{{$order->child_num - $order->child_finished_num}}</a></td>
                    <td class="child"><a href="/www/zhongchouAdmin/child_order?typeId={{$typeId}}&parentId={{$order->id}}&type=4">{{$order->all_num}}</a></td>

                    <td>{{$order->begin_time}}</td>
                    <td>{{$order->end_time}}</td>
                    <td>
                        @if($order->hand_status == 0)
                        <a href="/www/zhongchouAdmin/hand_order?orderId={{$order->id}}" class="btn btn-danger" onclick="return confirm('确定？');">确定
                        </a>
                        @else
                            <p>已处理</p>
                        @endif
                    </td>
                </tr>
            @endforeach
        </table>

        <div>
            {{ $orders->appends(Request::all())->links() }}
        </div>
    </div>
</div>



@endsection